<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ProfileBase>" %>

<asp:Content ID="cHead" ContentPlaceHolderID="cphHead" runat="server">
    <% this.Page.Title = (string)ViewData["PageTitle"]; %>
</asp:Content>

<asp:Content ID="cJScripts" ContentPlaceHolderID="cphJScripts" runat="server">
    <script type="text/javascript">
        $(document).ready(function() {
            $('.zitem').hover(function() {
                $(this).find('div.caption').stop(false, true).fadeIn(200);
            },
	        function() {
	            $(this).find('div.caption').stop(false, true).fadeOut(200);
	        });
        });
    </script>
</asp:Content>

<asp:Content ID="cMainContent" ContentPlaceHolderID="cphMainContent" runat="server">
    <div id="usersProfil">
        <div id="userDetail">
            <h1><%= Html.Encode(ScoutNET.Resources.Profil_Detail_Profile) %></h1>
            <div class="infoUser<%= Model["Sex"].ToString() %>">
                <ul>
                    <li><div class="label"><%= Html.Encode(ScoutNET.Resources.Profil_Detail_FirstName) %> :</div>&nbsp;<%= Model["FirstName"].ToString()%> </li>
                    <li><div class="label"><%= Html.Encode(ScoutNET.Resources.Profil_Detail_LastName) %> : </div>&nbsp;<%= Model["LastName"].ToString()%></li>
                    <li><div class="label"><%= Html.Encode(ScoutNET.Resources.Profil_Detail_Login) %> :</div>&nbsp;<%= ((MembershipUser)ViewData["User"]).UserName %></li>
                    <li><div class="label"><%= Html.Encode(ScoutNET.Resources.Profil_Detail_Function) %> :</div>&nbsp;<%= (string)ViewData["Role"] %></li>
                    <% if (!string.IsNullOrEmpty((string)ViewData["UserSection"])){ %>
                    <li><div class="label"><%= Html.Encode(ScoutNET.Resources.Profil_Detail_Section) %> : </div>&nbsp;<%= (string)ViewData["UserSection"] %></li>
                    <% } %>
                    <% if (!string.IsNullOrEmpty(Model["WebSite"].ToString())){ %>
                    <li><div class="label"><%= Html.Encode(ScoutNET.Resources.Profil_Detail_WebSite) %> :</div>&nbsp;<%= Html.ExtrenalLink(Model["WebSite"].ToString(), Model["WebSite"].ToString(), new { target = "_blank", rel = "external nofollow" })%></li>
                    <% } %>
                    <% if (!string.IsNullOrEmpty(Model["Totem"].ToString())){ %>                    
                    <li><div class="label"><%= Html.Encode(ScoutNET.Resources.Profil_Detail_Totem) %> :</div>&nbsp;<%= Model["Totem"].ToString()%></li>
                    <% } %>
                    <% if (!string.IsNullOrEmpty(Model["Location"].ToString())){ %>                    
                    <li><div class="label"><%= Html.Encode(ScoutNET.Resources.Profil_Detail_Location) %> : </div>&nbsp;<%= Model["Location"].ToString()%></li>
                    <% } %>
                    <li><div class="label"><%= Html.Encode(ScoutNET.Resources.Profil_Detail_CreationDate) %> :</div>&nbsp;<%= ((MembershipUser)ViewData["User"]).CreationDate.ToString("dd/MM/yyyy")%></li>
                    <li><div class="label"><%= Html.Encode(ScoutNET.Resources.Profil_Detail_LastActivityDate) %> :</div>&nbsp;<%= ((MembershipUser)ViewData["User"]).LastActivityDate.ToString("dd/MM/yyyy HH:mm")%></li>
                </ul>
            </div>
        </div>
         <% if (Model["Avatar"] != null && Model["Avatar"].ToString() != string.Empty){ %>
        <div id="avatar">
	        <h1><%= Html.Encode(ScoutNET.Resources.Profil_Detail_Avatar) %></h1>
	        <img src="<%= Model["Avatar"].ToString()%>" alt="" />
        </div>
        <% } %>
        <% if (Request.IsAuthenticated) { %>
        <div id="contactProfil">
            <h1><%= Html.Encode(ScoutNET.Resources.Profil_Detail_Contact) %> <%= ((MembershipUser)ViewData["User"]).UserName %></h1>
            <ul>
                <% if (!string.IsNullOrEmpty(Model["Phone"].ToString())){ %>    
                <li><div class="label"><%= Html.Encode(ScoutNET.Resources.Profil_Detail_Phone) %> : </div>&nbsp;<%= Model["Phone"].ToString()%></li>
                <% } %>
                <% if (!string.IsNullOrEmpty(((MembershipUser)ViewData["User"]).Email.ToString())) { %>    
                <li><div class="label"><%= Html.Encode(ScoutNET.Resources.Profil_Detail_Email) %> : </div>&nbsp;<%= ((MembershipUser)ViewData["User"]).Email %></li>
                <% } %>
            </ul>
        </div>
        <% } %>
        <div class="clr"></div>
        
        <h1><%= Html.Encode(ScoutNET.Resources.Profil_Detail_GalleryOf) %> <%= ((MembershipUser)ViewData["User"]).UserName %></h1>
        
        <% if (((List<sp_Site_GetRandomUserImageResult>)ViewData["UserImages"]).Count > 0){ %>
            <% foreach (sp_Site_GetRandomUserImageResult i in (List<sp_Site_GetRandomUserImageResult>)ViewData["UserImages"]){%>
            <div class="zitemBlock">
                <div class="zitem">
                    <%= Html.ActionLinkImage(i.AlbumName, Html.ImageResizedUrl("Membres", "ImageResize", i.AlbumName, i.ID), "Index", new { controller = "Photo", ID = i.AID, Title = i.AlbumName.ParseUrl(), systemName = i.SystemName.UppercaseFirst(), page = i.RowNumber })%>
                    <div class="caption">
                    <%= Html.ActionLink(i.AlbumName, "Index", new { controller = "Photo", ID = i.AID, Title = i.AlbumName.ParseUrl(), systemName = i.SystemName.UppercaseFirst(), page = i.RowNumber })%>
                    </div>
                </div>
            </div>
            <% } %>
            <div class="clr"></div>
        <% }else{ %>
            <div class="errorContent"><span><%= ViewData["NoPicture"] %></span></div>
        <% } %>
    </div>

</asp:Content>
